package com.cz.ssyx.activity.mapper;

import com.cz.ssyx.model.activity.CouponInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 优惠券信息 Mapper 接口
 * </p>
 *
 * @author Joker
 * @since 2024-04-20
 */

@Mapper
public interface CouponInfoMapper extends BaseMapper<CouponInfo> {

    //根据条件查询：skuId + categoryId + userId
    List<CouponInfo> selectCouponInfoList(@Param("skuId") Long skuId,
                                          @Param("categoryId") Long categoryId,
                                          @Param("userId") Long userId);

    //1.根据用户id获取该用户的所有优惠券
    List<CouponInfo> selectCartCouponInfoList(@Param("userId") Long userId);
}
